#ifndef NET_UDP_CLIENT_H
#define NET_UDP_CLIENT_H

#include "UDPSession.h"
using boost::asio::ip::udp;

namespace mp_net
{
	class UdpClient : public UdpSession
	{
	public:
		UdpClient(spIoService ioService);
		virtual ~UdpClient(){}

		virtual bool Start(){return false;}
		virtual bool Stop(bool wait=false){return false;}

		virtual void ThreadInitialization();
		virtual void ThreadUpdate();
		virtual void ThreadShutdown();

		void ConnectToServer(udp::endpoint ep);

	protected:

		/*! Handshake with the server to get id */
		bool HandshakeWithServer();
		void ParseInputBuffer();
		void BuildOutputBuffer();

		UdpConnection	m_serverConnection;
		udp::resolver	m_resolver;
	};
}
#endif